<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加比赛</title>
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-datetimepicker.min.css" />
</head>
<body>
<div>
    <div class="btn-group col-md-6 btn-group-justified " role="group">
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Match/index\')}'">添加比赛</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-primary" onclick="javascript:location.href='{:U(\'Team/index\')}'">添加队伍</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Userinfo/index\')}'">添加队员</button>
        </div>
    </div>
        <form class="form-horizontal" method="post" id="tt" autocomplete="on">
                <div class="form-group col-md-12" style="margin-top: 50px;">
                    <label class="col-md-2 control-label">比赛名称：</label>
                    <div class="col-md-4">
                        <select name="match_id" class="form-control">
                            <volist name="match" id="m">
                                <option value="{$m.id}">{$m.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">队伍名称：</label>
                    <div class="col-md-4">
                        <select name="corpsname" class="form-control">
                            <option value="">选择队伍名</option>
                            <volist name="corps" id="c">
                                <option value="{$c.corpsnumber},{$c.corpsname}">{$c.corpsname}</option>
                            </volist>
                        </select>

                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">比赛结果：</label>
                    <div class="col-md-4">
                        <select id="result" name="result" class="form-control">
                            <option value="">请选择</option>
                            <option value="胜">胜</option>
                            <option value="负">负</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">团队金币：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="money" name="money">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">视野率：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="horizons" name="horizons">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">大龙数量：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="big_dragon" name="big_dragon">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">小龙数量：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="small_dragon" name="small_dragon">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">阵营：</label>
                    <div class="col-md-4">
                        <select class="form-control" id="camp" name="camp">
                            <option value="">请选择</option>
                            <option value="蓝色方">蓝色方</option>
                            <option value="紫色方">紫色方</option>
                        </select>
                    </div>
                </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">领队：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="leader" name="leader">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">连胜：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="straight_num" name="straight_num">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">队伍荣誉：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="honor" name="honor">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-4 control-label"></label>
                <div class="col-md-8">
                    <button type="button" class="btn btn-primary" id="tijiao">保存</button>
                </div>
            </div>
        </form>
</div>
</body>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(".date-picker").datetimepicker({
        language: 'zh-CN',
    });
    $("#tijiao").on('click',function(){
        var form = $("#tt");
        $.ajax({
            url:form.attr("action"),
            type:'post',
            data:form.serialize(),
            dataType: 'json',
            success:function(data){
                alert(data.info);
                location.href="{:U(\'Userinfo/index\')}";
            }
        })
    })
</script>
</html>